<style>
    #topicPlan-add {
        padding: 20px 25px 0px 0;
    }

    .layui-form-label {
        width: 140px;
    }

    .layui-input-block {
        margin-left: 170px;
    }

    .layui-layer-page .layui-layer-content {
        overflow: visible !important;
    }
</style>
<div class="layui-fluid" id="topicPlan-add">
    <form class="layui-form" action="" lay-filter="topicPlan-add-form">
        <div class="layui-row layui-form-item">
            <div class="layui-col-md10">
                <label class="layui-form-label website-form-item-require">年份：</label>
                <div class="layui-input-block">
                    <input type="text" name="year" class="layui-input" readonly id="topicPlanYear">
                </div>
            </div>
        </div>

        <div class="layui-form-item website-hide">
            <button class="layui-btn" lay-submit="" lay-filter="topicPlan-add-form-submit" id="submit"></button>
            <button type="reset" class="layui-btn" id="reset"></button>
        </div>
    </form>
</div>

<script data-th-inline="javascript">
    layui.use(['website', 'form', 'validate', 'laydate'], function () {
        var $ = layui.$,
            website = layui.website,
            layer = layui.layer,
            form = layui.form,

            laydate = layui.laydate,
            $view = $('#topicPlan-add'),
            $reset = $view.find('#reset'),
            validate = layui.validate;
        form.verify(validate);
        form.render();
        //初始化时间
        laydate.render({
            elem: '#topicPlanYear' //指定元素
            , type: 'year',
            trigger: 'click',
            value: new Date()
        });

        form.on('submit(topicPlan-add-form-submit)', function (data) {
            website.post(ctx + 'biz/topicPlan', data.field, function () {
                layer.closeAll();
                website.alert.success('新增课题成功');
                $('#website-topic-plan').find('#query').click();
            });
            return false;
        });

        $reset.on('click', function () {
            $("#topicPlanYear").empty();
        });

    });
</script>